﻿using FlyingEye.Consts;
using System;

namespace FlyingEye.LogInformations
{
    /// <summary>
    /// 用户工单日志信息
    /// </summary>
    public class UserOrderLogInformation : LogInformation
    {
        public UserOrderLogInformation(Guid orderId, string action, Guid operatorId, string userName) : base(LogCategoryNames.UserOrder)
        {
            OrderId = orderId;
            Action = action;
            OperatorId = operatorId;
            UserName = userName;
        }

        public Guid OrderId { get; set; }

        /// <summary>
        /// 动作名称
        /// </summary>
        public string Action { get; set; }

        /// <summary>
        /// 仅当审批工单时生效
        /// </summary>
        public bool? IsAgree { get; set; }

        /// <summary>
        /// 操作者 ID
        /// </summary>
        public Guid OperatorId { get; set; }

        /// <summary>
        /// 操作者名称
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 如果是创建用户工单，则该名称是新工单的用户名
        /// 如果是审批工单，则该名称是新用户的用户名
        /// </summary>
        public string? NewUserName { get; set; }

        public DateTime DateTime { get; } = DateTime.UtcNow;
    }
}
